package com.learn.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.learn.dm.UserInfoDM;
import com.learn.service.dao.IUserInfoDao;
import com.learn.service.interfaces.IUserInfoService;
import com.learn.vo.UserInfoVO;

/**
 * 用户服务
 * 
 * @author Administrator
 * @version 1.0.0
 * @2021-06-26 09:28:35
 *
 */
@Service("userInfoService")
public class UserInfoServiceImpl implements IUserInfoService {
	
	@Resource
	IUserInfoDao userInfoDao;
     
	/**
	 * 查询用户表数据
	 */
    public List<UserInfoDM> getUserInfoList(UserInfoDM dm) {
        UserInfoVO userInfoVO = new UserInfoVO();
        userInfoVO.setUserName(dm.getUserName());
        List<UserInfoVO> listVO = userInfoDao.getUserInfoList(userInfoVO);
        if (null != listVO) {
        	 List<UserInfoDM> listDm = new ArrayList<UserInfoDM>();
             if (null != listVO) {
                 for (UserInfoVO vo : listVO) {
                	 UserInfoDM tDm = new UserInfoDM();
                     BeanUtils.copyProperties(vo, tDm);
                     listDm.add(tDm);
                 }
                 return listDm;
             }
        }
        return null;
    }
}
